#include <bits/stdc++.h>
using namespace std;
int father[50000];
int size[50000];
int n, m, q;
// 初始化并查集，每个元素的父节点设为自己
void init() {
  for (int i = 1; i <= n; i++) {
    father[i] = i;
    size[i] = 1;
  }
}
int find(int x) {
  if (father[x] == x)
    return x;

  return father[x] = find(father[x]);
}
// 按秩合并
void merge(int a, int b) {
  int ra = find(a);
  int rb = find(b);
  if (ra == rb)
    return;

  if (size[ra] > size[rb])
    swap(ra, rb);

  father[ra] = rb;

  size[rb] += size[ra];
}

int main() {
  cin >> n >> m >> q;
  init();
  for (int i = 1; i <= m; ++i) {
    int a, b;
    cin >> a >> b;
    merge(a, b);
  }
  for (int i = 1; i <= q; ++i) {
    int a, b;
    cin >> a >> b;
    if (find(a) == find(b)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}